﻿@model Tasks.UI.Models.DictManageModel
@{
    Layout = "~/Views/DijieAccount/_Master.cshtml";
}
@section head{
    <style type="text/css">
        *
        {
            margin: 0;
            padding: 0;
        }
        .container
        {
            width: 100%;
            padding: 10px 0px 0px 10px;
        }
        
        .tblStyle1 input
        {
            width: 100%;
        }
    </style>
    <script type="text/javascript">
        function goto() {
            $("form").submit();
        }
    </script>
}
<script src="@Url.Content("~/Scripts/page/dict.manage.js")" type="text/javascript"></script>
<form action="Manage" method="post">
<input type="hidden" name="typeName" value="@Model.typeName"/>
<div id="container">
    <div class="navTitle">
        <div class="left">
            资料 >> 购物类别 >> 操作
        </div>
    </div>
    <div class="searchBar">
        <div class="box">
            <table>
                <tr>
                    <td>
                        <label>
                            名称：</label>
                        @Html.TextBox("Name")
                        <a href="javascript:void(0);" onclick="goto()" class="soa">查询</a>
                        <input id="act" name="act" type="hidden" />
                        <input id="DictID" name="DictID" type="hidden" />
                    </td>
                </tr>
            </table>
            <div class="bottom">
            </div>
        </div>
    </div>
    <div class="pageBody">
        <table class="tblStyle1" id="tb">
            <thead>
                <tr>
                    <th style="width: 10%">
                        序号
                    </th>
                    <th style="width: 25%">
                        名称
                    </th>
                    <th style="width: 55%">
                        内容
                    </th>
                    <th style="width: 10%">
                        操作
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr style="display: none;">
                    <td class="info c" name="SNO">
                        <input id="SNO" name="SNO" type="hidden" class="hidSNO" />
                        <span class="SNO"></span>
                    </td>
                    <td class="info" name="Name">
                        <input id="Name" name="Name" type="text" />
                    </td>
                    <td class="info" name="Content">
                        <input id="Content" name="Content" type="text" />
                        @Html.Hidden("DictKey")
                    </td>
                    <td class="c">
                        <input type="hidden" value="0" />
                        <a href="javascript:void(0)" onclick="editRow(this)" class="btnEdit" style="display: none">
                            <img src="/images/icon/16x16/file_edit.png" title="编辑" /></a> <a href="javascript:void(0)"
                                onclick="setRowState(this,0)" class="btnCanelEdit">
                                <img src="/images/icon/16x16/cancel.png" title="取消" /></a> <a href="javascript:void(0)"
                                    onclick="delRow(this)" class="delRow" style="display: none">
                                    <img src="/images/icon/16x16/delete.png" title="删除" /></a><a href="javascript:void(0)"
                                        onclick="saveRow(this)" class="btnSaveRow"><img src="/images/icon/16x16/save.png"
                                            title="保存" /></a>
                    </td>
                </tr>
                @foreach (DictValue dict in Model.Dicts)
                { 
                    <tr class="edit" id="tpl">
                        <td class="info c" name="SNO">
                            @dict.SNO
                        </td>
                        <td class="info" name="Name">
                            @dict.Name
                        </td>
                        <td class="info" name="Content">@dict.Content
                        </td>
                        <td class="c">
                            @if (dict.OwnerID != 0)
                            {
                                <input id="ID" type="hidden" value="@dict.ID" name="ID"/>
                                <a href="javascript:void(0)" onclick="editRow(this)" class="btnEdit">
                                    <img src="/images/icon/16x16/file_edit.png" title="编辑" /></a> <a href="javascript:void(0)"
                                        onclick="setRowState(this,0)" class="btnCanelEdit" style="display: none"><img src="/images/icon/16x16/cancel.png"
                                            title="取消" /></a>
                                <a href="javascript:void(0)" onclick="delRow(this)" class="delRow">
                                    <img src="/images/icon/16x16/delete.png" title="删除" /></a><a href="javascript:void(0)"
                                        onclick="saveRow(this)" style="display: none" class="btnSaveRow"><img src="/images/icon/16x16/save.png"
                                            title="保存" /></a>
                            }
                        </td>
                    </tr>
                }
            </tbody>
        </table>
        <div class="fenye">
            @Html.RenderPageNav(Model.PageIndex, Model.PageSize, Model.RowCount, "", PageNavStyle.Form)
        </div>
    </div>
    <div class="Button_out" style="float: left;">
        <a href="javascript:addRow()">添加</a>
    </div>
</div>
</form>
